package com.shujia.day07.homework.car;



class Car{
        // 车型，车牌
    String type;
    String license;

//    方法包括：启动，停止


    public Car() {
    }

    public Car(String type, String license) {
        this.type = type;
        this.license = license;
    }

    public void start(){
        System.out.println("我是"+type+"，我启动");
    }

    public void stop(){
        System.out.println("我是"+type+"，我停止");
    }

}


class FamilyCar extends Car{
    String name ;

    public FamilyCar(String type, String license, String name) {
        super(type, license);
        this.name = name;
    }

    public void start(){
        System.out.println("我是"+name+"，我的汽车我做主");
    }

    public void stop(){
        System.out.println("目的地到了，我们去玩吧");
    }
}

class TaxiCar extends Car{
    String company;

    public TaxiCar(String type, String license, String company) {
        super(type, license);
        this.company = company;
    }

    public void start(){
        System.out.println("乘客您好~");
        System.out.println("我是"+company+"，我的车牌是"+license);
    }

    public void stop(){
        System.out.println("目的地到了，我们去玩吧");
    }
}


public class Test {
    public static void main(String[] args) {

        TaxiCar taxiCar = new TaxiCar("车", "京B123", "景顺出租车公司");
        taxiCar.start();
        taxiCar.stop();
    }
}
